package LeetCode.month04.day106;

/**
 * @author 16778
 * @date 2025/11/16 8:12
 * @description
 */
public class No1513 {
    public int numSub(String s) {
        long res = 0;
        int left = -1;
        int n = s.length();
        for (int right = 0; right < n; right++) {
            if(s.charAt(right) == '0'){
                left = right;
            }else{
                res += (right - left);
            }
        }
        return (int)(res % 1000000007);
    }
}
